#include "btnsettings.h"

#include <QFile>
BtnSettings::~BtnSettings()
{
    delete myMenu;
}

BtnSettings::BtnSettings(QWidget *parent) : QPushButton(parent)
{
    myMenu = new QMenu;
    QAction *helpAction = new QAction("帮助信息", this);
    QAction *aboutAction = new QAction("关于", this);
    myMenu->addAction(helpAction);
    myMenu->addAction(aboutAction);

    QFile file(":/prefix_qss/qss/menu.qss");
    file.open(QIODevice::ReadOnly);
    if(file.isOpen())
    {
        QString strFile = file.readAll();
        myMenu->setStyleSheet(strFile);
        file.close();
    }
    this->setMenu(myMenu);
}
